package com.itheima.controller;
import com.itheima.pojo.ClazzCountOption;
import com.itheima.pojo.JobDivision;
import com.itheima.pojo.Result;
import com.itheima.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportService reportService;
    @GetMapping("/empJobData")
    public Result getempJobData () {
        log.info("统计职位人数");
        JobDivision repoJob = reportService.getEmpJobData();
        return  Result.success(repoJob);
    }
    @GetMapping("empGenderData")
    public Result getGenderData(){
        log.info("统计员工性别信息");
        List<Map> genderList = reportService.getGenderData();
        return Result.success(genderList);
    }
    @GetMapping("/studentCountData")
    public Result getClazzCountOptionData(){
        log.info("统计班级学生人数");
        ClazzCountOption repostu = reportService.getClazzCountOptionData();
        return Result.success(repostu);
    }
    @GetMapping("studentDegreeData")
    public Result countDegreeData(){
        System.out.println("统计学生学历信息");
        List<Map> degreeList = reportService.countDegreeData();
        return Result.success(degreeList);
    }
}
